<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        
        <title>
            
    
                Overview
             &mdash; 
    SQLAlchemy 0.8 Documentation

        </title>
        
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/docs.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
          URL_ROOT:    '#',
          VERSION:     '0.8.2',
          COLLAPSE_MODINDEX: false,
          FILE_SUFFIX: '.html'
      };
    </script>
        <script type="text/javascript" src="_static/jquery.js"></script>
        <script type="text/javascript" src="_static/underscore.js"></script>
        <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/init.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
        <link rel="copyright" title="Copyright" href="copyright.html" />
    <link rel="top" title="SQLAlchemy 0.8 Documentation" href="index.html" />
        <link rel="next" title="SQLAlchemy ORM" href="orm/index.html" />
        <link rel="prev" title="Table of Contents" href="contents.html" />

    </head>
    <body>
        










<div id="docs-container">



<div id="docs-header">
    <h1>SQLAlchemy 0.8 Documentation</h1>

    <div id="docs-search">
    Search:
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" /> <input type="submit" value="Search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>

    <div id="docs-version-header">
        Release: <span class="version-num">0.8.2</span> | Release Date: July 3, 2013


    </div>

</div>

<div id="docs-top-navigation">
    <div id="docs-top-page-control" class="docs-navigation-links">
        <ul>
            <li>Prev:
            <a href="contents.html" title="previous chapter">Table of Contents</a>
            </li>
            <li>Next:
            <a href="orm/index.html" title="next chapter">SQLAlchemy ORM</a>
            </li>

        <li>
            <a href="contents.html">Table of Contents</a> |
            <a href="genindex.html">Index</a>
            | <a href="_sources/intro.txt">view source
        </li>
        </ul>
    </div>

    <div id="docs-navigation-banner">
        <a href="index.html">SQLAlchemy 0.8 Documentation</a>
        » 
                Overview
             

        <h2>
            
                Overview
            
        </h2>
    </div>

</div>

<div id="docs-body-container">

    <div id="docs-sidebar">
    <h3><a href="index.html">Table of Contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">Overview</a><ul>
<li><a class="reference internal" href="#id1">Overview</a></li>
<li><a class="reference internal" href="#documentation-overview">Documentation Overview</a></li>
<li><a class="reference internal" href="#code-examples">Code Examples</a></li>
<li><a class="reference internal" href="#installation-guide">Installation Guide</a><ul>
<li><a class="reference internal" href="#supported-platforms">Supported Platforms</a></li>
<li><a class="reference internal" href="#supported-installation-methods">Supported Installation Methods</a></li>
<li><a class="reference internal" href="#install-via-easy-install-or-pip">Install via easy_install or pip</a></li>
<li><a class="reference internal" href="#installing-using-setup-py">Installing using setup.py</a></li>
<li><a class="reference internal" href="#installing-the-c-extensions">Installing the C Extensions</a></li>
<li><a class="reference internal" href="#installing-on-python-3">Installing on Python 3</a></li>
<li><a class="reference internal" href="#installing-a-database-api">Installing a Database API</a></li>
<li><a class="reference internal" href="#checking-the-installed-sqlalchemy-version">Checking the Installed SQLAlchemy Version</a></li>
</ul>
</li>
<li><a class="reference internal" href="#to-0-8-migration">0.7 to 0.8 Migration</a></li>
</ul>
</li>
</ul>


    <h4>Previous Topic</h4>
    <p>
    <a href="contents.html" title="previous chapter">Table of Contents</a>
    </p>
    <h4>Next Topic</h4>
    <p>
    <a href="orm/index.html" title="next chapter">SQLAlchemy ORM</a>
    </p>


    <h4>Quick Search</h4>
    <p>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" /> <input type="submit" value="Search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </p>

    </div>

    <div id="docs-body" class="withsidebar" >
        
<div class="section" id="overview">
<span id="overview-toplevel"></span><h1>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<span id="id2"></span><h2>Overview<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<p>The SQLAlchemy SQL Toolkit and Object Relational Mapper
is a comprehensive set of tools for working with
databases and Python. It has several distinct areas of
functionality which can be used individually or combined
together. Its major components are illustrated in below,
with component dependencies organized into layers:</p>
<img alt="_images/sqla_arch_small.png" src="_images/sqla_arch_small.png" />
<p>Above, the two most significant front-facing portions of
SQLAlchemy are the <strong>Object Relational Mapper</strong> and the
<strong>SQL Expression Language</strong>. SQL Expressions can be used
independently of the ORM. When using the ORM, the SQL
Expression language remains part of the public facing API
as it is used within object-relational configurations and
queries.</p>
</div>
<div class="section" id="documentation-overview">
<span id="doc-overview"></span><h2>Documentation Overview<a class="headerlink" href="#documentation-overview" title="Permalink to this headline">¶</a></h2>
<p>The documentation is separated into three sections: <a class="reference internal" href="orm/index.html"><em>SQLAlchemy ORM</em></a>,
<a class="reference internal" href="core/index.html"><em>SQLAlchemy Core</em></a>, and <a class="reference internal" href="dialects/index.html"><em>Dialects</em></a>.</p>
<p>In <a class="reference internal" href="orm/index.html"><em>SQLAlchemy ORM</em></a>, the Object Relational Mapper is introduced and fully
described. New users should begin with the <a class="reference internal" href="orm/tutorial.html"><em>Object Relational Tutorial</em></a>. If you
want to work with higher-level SQL which is constructed automatically for you,
as well as management of Python objects, proceed to this tutorial.</p>
<p>In <a class="reference internal" href="core/index.html"><em>SQLAlchemy Core</em></a>, the breadth of SQLAlchemy&#8217;s SQL and database
integration and description services are documented, the core of which is the
SQL Expression language. The SQL Expression Language is a toolkit all its own,
independent of the ORM package, which can be used to construct manipulable SQL
expressions which can be programmatically constructed, modified, and executed,
returning cursor-like result sets. In contrast to the ORM&#8217;s domain-centric
mode of usage, the expression language provides a schema-centric usage
paradigm. New users should begin here with <a class="reference internal" href="core/tutorial.html"><em>SQL Expression Language Tutorial</em></a>.
SQLAlchemy engine, connection, and pooling services are also described in
<a class="reference internal" href="core/index.html"><em>SQLAlchemy Core</em></a>.</p>
<p>In <a class="reference internal" href="dialects/index.html"><em>Dialects</em></a>, reference documentation for all provided
database and DBAPI backends is provided.</p>
</div>
<div class="section" id="code-examples">
<h2>Code Examples<a class="headerlink" href="#code-examples" title="Permalink to this headline">¶</a></h2>
<p>Working code examples, mostly regarding the ORM, are included in the
SQLAlchemy distribution. A description of all the included example
applications is at <a class="reference internal" href="orm/examples.html"><em>Examples</em></a>.</p>
<p>There is also a wide variety of examples involving both core SQLAlchemy
constructs as well as the ORM on the wiki.  See
<a class="reference external" href="http://www.sqlalchemy.org/trac/wiki/UsageRecipes">Theatrum Chemicum</a>.</p>
</div>
<div class="section" id="installation-guide">
<span id="installation"></span><h2>Installation Guide<a class="headerlink" href="#installation-guide" title="Permalink to this headline">¶</a></h2>
<div class="section" id="supported-platforms">
<h3>Supported Platforms<a class="headerlink" href="#supported-platforms" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy has been tested against the following platforms:</p>
<ul class="simple">
<li>cPython since version 2.5, through the 2.xx series</li>
<li>cPython version 3, throughout all 3.xx series</li>
<li><a class="reference external" href="http://www.jython.org/">Jython</a> 2.5 or greater</li>
<li><a class="reference external" href="http://pypy.org/">Pypy</a> 1.5 or greater</li>
</ul>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.8: </span>Python 2.5 is now the minimum Python version supported.</p>
</div>
<div class="section" id="supported-installation-methods">
<h3>Supported Installation Methods<a class="headerlink" href="#supported-installation-methods" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy supports installation using standard Python &#8220;distutils&#8221; or
&#8220;setuptools&#8221; methodologies. An overview of potential setups is as follows:</p>
<ul class="simple">
<li><strong>Plain Python Distutils</strong> - SQLAlchemy can be installed with a clean
Python install using the services provided via <a class="reference external" href="http://docs.python.org/distutils/">Python Distutils</a>,
using the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script. The C extensions as well as Python 3 builds are supported.</li>
<li><strong>Standard Setuptools</strong> - When using <a class="reference external" href="http://pypi.python.org/pypi/setuptools/">setuptools</a>,
SQLAlchemy can be installed via <tt class="docutils literal"><span class="pre">setup.py</span></tt> or <tt class="docutils literal"><span class="pre">easy_install</span></tt>, and the C
extensions are supported.  setuptools is not supported on Python 3 at the time
of this writing.</li>
<li><strong>Distribute</strong> - With <a class="reference external" href="http://pypi.python.org/pypi/distribute/">distribute</a>,
SQLAlchemy can be installed via <tt class="docutils literal"><span class="pre">setup.py</span></tt> or <tt class="docutils literal"><span class="pre">easy_install</span></tt>, and the C
extensions as well as Python 3 builds are supported.</li>
<li><strong>pip</strong> - <a class="reference external" href="http://pypi.python.org/pypi/pip/">pip</a> is an installer that
rides on top of <tt class="docutils literal"><span class="pre">setuptools</span></tt> or <tt class="docutils literal"><span class="pre">distribute</span></tt>, replacing the usage
of <tt class="docutils literal"><span class="pre">easy_install</span></tt>.  It is often preferred for its simpler mode of usage.</li>
</ul>
</div>
<div class="section" id="install-via-easy-install-or-pip">
<h3>Install via easy_install or pip<a class="headerlink" href="#install-via-easy-install-or-pip" title="Permalink to this headline">¶</a></h3>
<p>When <tt class="docutils literal"><span class="pre">easy_install</span></tt> or <tt class="docutils literal"><span class="pre">pip</span></tt> is available, the distribution can be
downloaded from Pypi and installed in one step:</p>
<div class="highlight-python"><pre>easy_install SQLAlchemy</pre>
</div>
<p>Or with pip:</p>
<div class="highlight-python"><pre>pip install SQLAlchemy</pre>
</div>
<p>This command will download the latest version of SQLAlchemy from the <a class="reference external" href="http://pypi.python.org/pypi/SQLAlchemy">Python
Cheese Shop</a> and install it to your system.</p>
</div>
<div class="section" id="installing-using-setup-py">
<h3>Installing using setup.py<a class="headerlink" href="#installing-using-setup-py" title="Permalink to this headline">¶</a></h3>
<p>Otherwise, you can install from the distribution using the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script:</p>
<div class="highlight-python"><pre>python setup.py install</pre>
</div>
</div>
<div class="section" id="installing-the-c-extensions">
<h3>Installing the C Extensions<a class="headerlink" href="#installing-the-c-extensions" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy includes C extensions which provide an extra speed boost for
dealing with result sets. Currently, the extensions are only supported on the
2.xx series of cPython, not Python 3 or Pypy.</p>
<p>setup.py will automatically build the extensions if an appropriate platform is
detected. If the build of the C extensions fails, due to missing compiler or
other issue, the setup process will output a warning message, and re-run the
build without the C extensions, upon completion reporting final status.</p>
<p>To run the build/install without even attempting to compile the C extensions,
pass the flag <tt class="docutils literal"><span class="pre">--without-cextensions</span></tt> to the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script:</p>
<div class="highlight-python"><pre>python setup.py --without-cextensions install</pre>
</div>
<p>Or with pip:</p>
<div class="highlight-python"><pre>pip install --global-option='--without-cextensions' SQLAlchemy</pre>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The <tt class="docutils literal"><span class="pre">--without-cextensions</span></tt> flag is available <strong>only</strong> if <tt class="docutils literal"><span class="pre">setuptools</span></tt>
or <tt class="docutils literal"><span class="pre">distribute</span></tt> is installed.  It is not available on a plain Python <tt class="docutils literal"><span class="pre">distutils</span></tt>
installation.  The library will still install without the C extensions if they
cannot be built, however.</p>
</div>
</div>
<div class="section" id="installing-on-python-3">
<h3>Installing on Python 3<a class="headerlink" href="#installing-on-python-3" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy ships as Python 2 code. For Python 3 usage, the <tt class="docutils literal"><span class="pre">setup.py</span></tt> script
will invoke the Python <tt class="docutils literal"><span class="pre">2to3</span></tt> tool on the build, plugging in an extra
&#8220;preprocessor&#8221; as well. The 2to3 step works with Python distutils
(part of the standard Python install) and Distribute - it will <strong>not</strong>
work with a non-Distribute setuptools installation.</p>
</div>
<div class="section" id="installing-a-database-api">
<h3>Installing a Database API<a class="headerlink" href="#installing-a-database-api" title="Permalink to this headline">¶</a></h3>
<p>SQLAlchemy is designed to operate with a <a class="reference internal" href="glossary.html#term-dbapi"><em class="xref std std-term">DBAPI</em></a> implementation built for a
particular database, and includes support for the most popular databases.
The individual database sections in <a class="reference internal" href="dialects/index.html"><em>Dialects</em></a> enumerate
the available DBAPIs for each database, including external links.</p>
</div>
<div class="section" id="checking-the-installed-sqlalchemy-version">
<h3>Checking the Installed SQLAlchemy Version<a class="headerlink" href="#checking-the-installed-sqlalchemy-version" title="Permalink to this headline">¶</a></h3>
<p>This documentation covers SQLAlchemy version 0.8. If you&#8217;re working on a
system that already has SQLAlchemy installed, check the version from your
Python prompt like this:</p>
<div class="highlight-python+sql"><div class="highlight"><pre><span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">sqlalchemy</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">sqlalchemy</span><span class="o">.</span><span class="n">__version__</span> 
<span class="mf">0.8</span><span class="o">.</span><span class="mi">0</span></pre></div>
</div>
</div>
</div>
<div class="section" id="to-0-8-migration">
<span id="migration"></span><h2>0.7 to 0.8 Migration<a class="headerlink" href="#to-0-8-migration" title="Permalink to this headline">¶</a></h2>
<p>Notes on what&#8217;s changed from 0.7 to 0.8 is available here at <a class="reference internal" href="changelog/migration_08.html"><em>What&#8217;s New in SQLAlchemy 0.8?</em></a>.</p>
</div>
</div>

    </div>

</div>

<div id="docs-bottom-navigation" class="docs-navigation-links">
        Previous:
        <a href="contents.html" title="previous chapter">Table of Contents</a>
        Next:
        <a href="orm/index.html" title="next chapter">SQLAlchemy ORM</a>

    <div id="docs-copyright">
        &copy; <a href="copyright.html">Copyright</a> 2007-2013, the SQLAlchemy authors and contributors.
        Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
</div>

</div>

        
    </body>
</html>


